#!bin/bash

func()
{
now_date=`date "+%Y-%m-%d"`
success_flag_timetamp=''
yest_date=`date -d yesterday "+%Y-%m-%d"`
while [ -z "$success_flag_timetamp" ]
do
  success_flag_timetamp=`hdfs dfs -stat "%Y" hdfs://yl-bg-hdp/dw/hive/jms_dm.db/external/dm_waybill_collect_intime_rate_dt/dt=$yest_date/`
  echo $success_flag_timetamp
  sleep 1m
done
success_flag=`expr $success_flag_timetamp / 1000`
flag_date=`date -d@$success_flag "+%Y-%m-%d"`
echo $now_date
echo $flag_date
#echo $success_flag_timetamp
}
while [ $now_date != $flag_date ]
do
  sleep 1m
  func
done
echo "success~~~"



